﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Linq查询语法Select、Where、OrderBy、OrderByDescending、GroupBy、Join、GroupJoin.aspx.cs" Inherits="_35newpart_Linq_Linq查询语法Select_Where_OrderBy_OrderByDescending_GroupBy_Join_GroupJoin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">


.postbody a
{
	color: #1D58D1;
}


a
{
	color: #223355;
	text-decoration: none;
}

    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <br />
        <div align="center">
            <font face="Verdana">步步为营VS 2008 + .NET 3.5(5) - 
            LINQ查询操作符之Select、Where、OrderBy、OrderByDescending、GroupBy、Join、GroupJoin及其对应的查询语法</font></div>
        <br />
        <br />
        作者：<a href="http://webabcd.cnblogs.com/" target="_blank">webabcd</a><br />
        <br />
        <br />
        介绍<br />
        &nbsp;&nbsp;&nbsp; ·Select - <font face="Verdana">Select选择；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·Where - <font face="Verdana">Where查询；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·OrderBy - <font face="Verdana">按指定表达式对集合正序排序；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·OrderByDescending - <font face="Verdana">按指定表达式对集合倒序排序；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·GroupBy - <font face="Verdana">分组；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·Join - <font face="Verdana">Join查询；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·GroupJoin - <font face="Verdana">分组Join查询；延迟</font><br />
        &nbsp;&nbsp;&nbsp; ·以上查询操作符所对应的查询语法<br />
        <br />
        <br />
        示例<br />
        <font face="Verdana">Summary.aspx.cs</font><br />
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Data;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Configuration;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Linq;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.Security;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI.WebControls;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI.WebControls.WebParts;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI.HtmlControls;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Xml.Linq;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;DAL;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /></span><span 
                style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span 
                style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;LINQ_Summary&nbsp;:&nbsp;System.Web.UI.Page<br />
            <img id="Codehighlighter1_406_1189_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_406_1189_Open_Text.style.display='none'; Codehighlighter1_406_1189_Closed_Image.style.display='inline'; Codehighlighter1_406_1189_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_406_1189_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_406_1189_Closed_Text.style.display='none'; Codehighlighter1_406_1189_Open_Image.style.display='inline'; Codehighlighter1_406_1189_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /></span><span 
                id="Codehighlighter1_406_1189_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_406_1189_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;NorthwindDataContext&nbsp;_ctx&nbsp;=&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;NorthwindDataContext();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">[]&nbsp;_ary&nbsp;=&nbsp;</span><span 
                style="COLOR: #0000ff">null</span><span style="COLOR: #000000">;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span 
                style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span 
                style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
            <img id="Codehighlighter1_556_1187_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_556_1187_Open_Text.style.display='none'; Codehighlighter1_556_1187_Closed_Image.style.display='inline'; Codehighlighter1_556_1187_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_556_1187_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_556_1187_Closed_Text.style.display='none'; Codehighlighter1_556_1187_Open_Image.style.display='inline'; Codehighlighter1_556_1187_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_556_1187_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_556_1187_Open_Text"><span style="COLOR: #000000">{<br />
            <img id="Codehighlighter1_586_760_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_586_760_Open_Text.style.display='none'; Codehighlighter1_586_760_Closed_Image.style.display='inline'; Codehighlighter1_586_760_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_586_760_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_586_760_Closed_Text.style.display='none'; Codehighlighter1_586_760_Open_Image.style.display='inline'; Codehighlighter1_586_760_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_ary&nbsp;=&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">[]&nbsp;</span><span 
                id="Codehighlighter1_586_760_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_586_760_Open_Text"><span style="COLOR: #000000">{&nbsp;&quot;asp.net&quot;,&nbsp;&quot;csharp&quot;,&nbsp;&quot;xhtml&quot;,&nbsp;&quot;css&quot;,&nbsp;&quot;javascript&quot;,&nbsp;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wcf&quot;,&nbsp;&quot;wpf&quot;,&nbsp;&quot;silverlight&quot;,&nbsp;&quot;linq&quot;,&nbsp;&quot;wf&quot;,&nbsp;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sqlserver&quot;,&nbsp;&quot;asp.net&nbsp;ajax&quot;,&nbsp;&quot;ssis&quot;,&nbsp;&quot;ssas&quot;,&nbsp;&quot;ssrs&quot;&nbsp;}</span></span><span 
                style="COLOR: #000000">;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;Select&nbsp;-&nbsp;Select选择；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Summary_Select();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;Where&nbsp;-&nbsp;Where查询；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Summary_Where();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;OrderBy&nbsp;-&nbsp;按指定表达式对集合正序排序；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;OrderByDescending&nbsp;-&nbsp;按指定表达式对集合倒序排序；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Summary_OrderBy_OrderByDescending();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;GroupBy&nbsp;-&nbsp;分组；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Summary_GroupBy();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;Join&nbsp;-&nbsp;Join查询；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Summary_Join();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;GroupJoin&nbsp;-&nbsp;分组Join查询；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Summary_GroupJoin();<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span></div>
        <br />
        <font face="Verdana">Select - Select选择；延迟</font><br />
        <font face="Verdana">
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img id="Codehighlighter1_4_65_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_65_Open_Text.style.display='none'; Codehighlighter1_4_65_Closed_Image.style.display='inline'; Codehighlighter1_4_65_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_4_65_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_65_Closed_Text.style.display='none'; Codehighlighter1_4_65_Open_Image.style.display='inline'; Codehighlighter1_4_65_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_4_65_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                id="Codehighlighter1_4_65_Open_Text"><span style="COLOR: #808080">///</span><span 
                style="COLOR: #008000">&nbsp;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span 
                style="COLOR: #008000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;Select&nbsp;-&nbsp;Select选择；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;</span><span 
                style="COLOR: #808080">&lt;/summary&gt;</span></span><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span 
                style="COLOR: #000000">&nbsp;Summary_Select()<br />
            <img id="Codehighlighter1_96_727_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_96_727_Open_Text.style.display='none'; Codehighlighter1_96_727_Closed_Image.style.display='inline'; Codehighlighter1_96_727_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_96_727_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_96_727_Closed_Text.style.display='none'; Codehighlighter1_96_727_Open_Image.style.display='inline'; Codehighlighter1_96_727_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_96_727_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_96_727_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;使用Select查询操作符<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;categories&nbsp;=&nbsp;_ctx.Categories.Select(<br />
            <img id="Codehighlighter1_193_235_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_193_235_Open_Text.style.display='none'; Codehighlighter1_193_235_Closed_Image.style.display='inline'; Codehighlighter1_193_235_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_193_235_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_193_235_Closed_Text.style.display='none'; Codehighlighter1_193_235_Open_Image.style.display='inline'; Codehighlighter1_193_235_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;=&gt;&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_193_235_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_193_235_Open_Text"><span style="COLOR: #000000">{&nbsp;CategoryName&nbsp;=&nbsp;&quot;类别名称：&quot;&nbsp;+&nbsp;c.CategoryName&nbsp;}</span></span><span 
                style="COLOR: #000000">);<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;c&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;categories)<br />
            <img id="Codehighlighter1_286_355_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_286_355_Open_Text.style.display='none'; Codehighlighter1_286_355_Closed_Image.style.display='inline'; Codehighlighter1_286_355_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_286_355_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_286_355_Closed_Text.style.display='none'; Codehighlighter1_286_355_Open_Image.style.display='inline'; Codehighlighter1_286_355_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_286_355_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_286_355_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;c.CategoryName&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;与上面的Select查询操作符相对应的查询语法<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;categories2&nbsp;=&nbsp;from&nbsp;c&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ctx.Categories<br />
            <img id="Codehighlighter1_521_563_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_521_563_Open_Text.style.display='none'; Codehighlighter1_521_563_Closed_Image.style.display='inline'; Codehighlighter1_521_563_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_521_563_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_521_563_Closed_Text.style.display='none'; Codehighlighter1_521_563_Open_Image.style.display='inline'; Codehighlighter1_521_563_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_521_563_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_521_563_Open_Text"><span style="COLOR: #000000">{&nbsp;CategoryName&nbsp;=&nbsp;&quot;类别名称：&quot;&nbsp;+&nbsp;c.CategoryName&nbsp;}</span></span><span 
                style="COLOR: #000000">;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;c&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;categories2)<br />
            <img id="Codehighlighter1_614_683_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_614_683_Open_Text.style.display='none'; Codehighlighter1_614_683_Closed_Image.style.display='inline'; Codehighlighter1_614_683_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_614_683_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_614_683_Closed_Text.style.display='none'; Codehighlighter1_614_683_Open_Image.style.display='inline'; Codehighlighter1_614_683_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_614_683_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_614_683_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;c.CategoryName&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
        运行结果<br />
        类别名称：Beverages<br />
        类别名称：Condiments<br />
        类别名称：Confections<br />
        类别名称：Dairy Products<br />
        类别名称：Grains/Cereals<br />
        类别名称：Meat/Poultry<br />
        类别名称：Produce<br />
        类别名称：Seafood<br />
        <br />
        Where - Where查询；延迟<br />
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img id="Codehighlighter1_4_63_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_63_Open_Text.style.display='none'; Codehighlighter1_4_63_Closed_Image.style.display='inline'; Codehighlighter1_4_63_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_4_63_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_63_Closed_Text.style.display='none'; Codehighlighter1_4_63_Open_Image.style.display='inline'; Codehighlighter1_4_63_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_4_63_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                id="Codehighlighter1_4_63_Open_Text"><span style="COLOR: #808080">///</span><span 
                style="COLOR: #008000">&nbsp;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span 
                style="COLOR: #008000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;Where&nbsp;-&nbsp;Where查询；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;</span><span 
                style="COLOR: #808080">&lt;/summary&gt;</span></span><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span 
                style="COLOR: #000000">&nbsp;Summary_Where()<br />
            <img id="Codehighlighter1_93_636_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_93_636_Open_Text.style.display='none'; Codehighlighter1_93_636_Closed_Image.style.display='inline'; Codehighlighter1_93_636_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_93_636_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_93_636_Closed_Text.style.display='none'; Codehighlighter1_93_636_Open_Image.style.display='inline'; Codehighlighter1_93_636_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_93_636_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_93_636_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;使用Where查询操作符<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;ary&nbsp;=&nbsp;_ary.Where(a&nbsp;=&gt;&nbsp;a.StartsWith(&quot;w&quot;)&nbsp;&amp;&amp;&nbsp;a.EndsWith(&quot;f&quot;));<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;s&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;ary)<br />
            <img id="Codehighlighter1_235_291_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_235_291_Open_Text.style.display='none'; Codehighlighter1_235_291_Closed_Image.style.display='inline'; Codehighlighter1_235_291_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_235_291_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_235_291_Closed_Text.style.display='none'; Codehighlighter1_235_291_Open_Image.style.display='inline'; Codehighlighter1_235_291_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_235_291_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_235_291_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;s&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;与上面的Where查询操作符相对应的查询语法<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;ary2&nbsp;=&nbsp;from&nbsp;a&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ary<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;a.StartsWith(&quot;w&quot;)&nbsp;&amp;&amp;&nbsp;a.EndsWith(&quot;f&quot;)<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;a;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;s&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;ary2)<br />
            <img id="Codehighlighter1_536_592_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_536_592_Open_Text.style.display='none'; Codehighlighter1_536_592_Closed_Image.style.display='inline'; Codehighlighter1_536_592_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_536_592_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_536_592_Closed_Text.style.display='none'; Codehighlighter1_536_592_Open_Image.style.display='inline'; Codehighlighter1_536_592_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_536_592_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_536_592_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;s&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
        运行结果<br />
        wcf<br />
        wpf<br />
        wf<br />
        <br />
        OrderBy - 按指定表达式对集合正序排序；延迟<br />
        OrderByDescending - 按指定表达式对集合倒序排序；延迟<br />
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img id="Codehighlighter1_4_116_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_116_Open_Text.style.display='none'; Codehighlighter1_4_116_Closed_Image.style.display='inline'; Codehighlighter1_4_116_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_4_116_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_116_Closed_Text.style.display='none'; Codehighlighter1_4_116_Open_Image.style.display='inline'; Codehighlighter1_4_116_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_4_116_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                id="Codehighlighter1_4_116_Open_Text"><span style="COLOR: #808080">///</span><span 
                style="COLOR: #008000">&nbsp;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span 
                style="COLOR: #008000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;OrderBy&nbsp;-&nbsp;按指定表达式对集合正序排序；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;OrderByDescending&nbsp;-&nbsp;按指定表达式对集合倒序排序；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;</span><span 
                style="COLOR: #808080">&lt;/summary&gt;</span></span><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span 
                style="COLOR: #000000">&nbsp;Summary_OrderBy_OrderByDescending()<br />
            <img id="Codehighlighter1_166_796_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_166_796_Open_Text.style.display='none'; Codehighlighter1_166_796_Closed_Image.style.display='inline'; Codehighlighter1_166_796_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_166_796_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_166_796_Closed_Text.style.display='none'; Codehighlighter1_166_796_Open_Image.style.display='inline'; Codehighlighter1_166_796_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_166_796_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_166_796_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;使用OrderBy查询操作符<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;ary&nbsp;=&nbsp;(from&nbsp;a&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ary<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;a).OrderBy(a&nbsp;=&gt;&nbsp;a.Length);&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;OrderByDescending与OrderBy用法相同<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;s&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;ary)<br />
            <img id="Codehighlighter1_357_413_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_357_413_Open_Text.style.display='none'; Codehighlighter1_357_413_Closed_Image.style.display='inline'; Codehighlighter1_357_413_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_357_413_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_357_413_Closed_Text.style.display='none'; Codehighlighter1_357_413_Open_Image.style.display='inline'; Codehighlighter1_357_413_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_357_413_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_357_413_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;s&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;与上面的OrderBy查询操作符相对应的查询语法<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;ary2&nbsp;=&nbsp;from&nbsp;a&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ary<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;orderby&nbsp;a.Length&nbsp;ascending&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;orderby&nbsp;xxx&nbsp;descending与orderby&nbsp;xxx&nbsp;ascending用法相同<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;a;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;s&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;ary2)<br />
            <img id="Codehighlighter1_696_752_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_696_752_Open_Text.style.display='none'; Codehighlighter1_696_752_Closed_Image.style.display='inline'; Codehighlighter1_696_752_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_696_752_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_696_752_Closed_Text.style.display='none'; Codehighlighter1_696_752_Open_Image.style.display='inline'; Codehighlighter1_696_752_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_696_752_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_696_752_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;s&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
        运行结果<br />
        wf<br />
        css<br />
        wcf<br />
        wpf<br />
        linq<br />
        ssis<br />
        ssas<br />
        ssrs<br />
        xhtml<br />
        csharp<br />
        asp.net<br />
        sqlserver<br />
        javascript<br />
        silverlight<br />
        asp.net ajax<br />
        <br />
        GroupBy - 分组；延迟<br />
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img id="Codehighlighter1_4_60_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_60_Open_Text.style.display='none'; Codehighlighter1_4_60_Closed_Image.style.display='inline'; Codehighlighter1_4_60_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_4_60_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_60_Closed_Text.style.display='none'; Codehighlighter1_4_60_Open_Image.style.display='inline'; Codehighlighter1_4_60_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_4_60_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                id="Codehighlighter1_4_60_Open_Text"><span style="COLOR: #808080">///</span><span 
                style="COLOR: #008000">&nbsp;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span 
                style="COLOR: #008000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;GroupBy&nbsp;-&nbsp;分组；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;</span><span 
                style="COLOR: #808080">&lt;/summary&gt;</span></span><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span 
                style="COLOR: #000000">&nbsp;Summary_GroupBy()<br />
            <img id="Codehighlighter1_92_1020_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_92_1020_Open_Text.style.display='none'; Codehighlighter1_92_1020_Closed_Image.style.display='inline'; Codehighlighter1_92_1020_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_92_1020_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_92_1020_Closed_Text.style.display='none'; Codehighlighter1_92_1020_Open_Image.style.display='inline'; Codehighlighter1_92_1020_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_92_1020_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_92_1020_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;使用GroupBy查询操作符<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;list&nbsp;=&nbsp;(from&nbsp;a&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ary<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;a).GroupBy(a&nbsp;=&gt;&nbsp;a.Length).Select(<br />
            <img id="Codehighlighter1_249_277_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_249_277_Open_Text.style.display='none'; Codehighlighter1_249_277_Closed_Image.style.display='inline'; Codehighlighter1_249_277_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_249_277_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_249_277_Closed_Text.style.display='none'; Codehighlighter1_249_277_Open_Image.style.display='inline'; Codehighlighter1_249_277_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g&nbsp;=&gt;&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_249_277_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_249_277_Open_Text"><span style="COLOR: #000000">{&nbsp;Group&nbsp;=&nbsp;g.Key,&nbsp;Member&nbsp;=&nbsp;g&nbsp;}</span></span><span 
                style="COLOR: #000000">);<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;g&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;list)<br />
            <img id="Codehighlighter1_322_517_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_322_517_Open_Text.style.display='none'; Codehighlighter1_322_517_Closed_Image.style.display='inline'; Codehighlighter1_322_517_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_322_517_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_322_517_Closed_Text.style.display='none'; Codehighlighter1_322_517_Open_Image.style.display='inline'; Codehighlighter1_322_517_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_322_517_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_322_517_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;g.Group&nbsp;+&nbsp;&quot;个字符：&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;s&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;g.Member)<br />
            <img id="Codehighlighter1_436_507_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_436_507_Open_Text.style.display='none'; Codehighlighter1_436_507_Closed_Image.style.display='inline'; Codehighlighter1_436_507_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_436_507_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_436_507_Closed_Text.style.display='none'; Codehighlighter1_436_507_Open_Image.style.display='inline'; Codehighlighter1_436_507_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_436_507_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_436_507_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;--&quot;&nbsp;+&nbsp;s&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;与上面的GroupBy查询操作符相对应的查询语法<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;list2&nbsp;=&nbsp;from&nbsp;a&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ary<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group&nbsp;a&nbsp;by&nbsp;a.Length&nbsp;into&nbsp;g<br />
            <img id="Codehighlighter1_708_736_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_708_736_Open_Text.style.display='none'; Codehighlighter1_708_736_Closed_Image.style.display='inline'; Codehighlighter1_708_736_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_708_736_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_708_736_Closed_Text.style.display='none'; Codehighlighter1_708_736_Open_Image.style.display='inline'; Codehighlighter1_708_736_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_708_736_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_708_736_Open_Text"><span style="COLOR: #000000">{&nbsp;Group&nbsp;=&nbsp;g.Key,&nbsp;Member&nbsp;=&nbsp;g&nbsp;}</span></span><span 
                style="COLOR: #000000">;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;g&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;list2)<br />
            <img id="Codehighlighter1_781_976_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_781_976_Open_Text.style.display='none'; Codehighlighter1_781_976_Closed_Image.style.display='inline'; Codehighlighter1_781_976_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_781_976_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_781_976_Closed_Text.style.display='none'; Codehighlighter1_781_976_Open_Image.style.display='inline'; Codehighlighter1_781_976_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_781_976_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_781_976_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;g.Group&nbsp;+&nbsp;&quot;个字符：&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(</span><span 
                style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;s&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;g.Member)<br />
            <img id="Codehighlighter1_895_966_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_895_966_Open_Text.style.display='none'; Codehighlighter1_895_966_Closed_Image.style.display='inline'; Codehighlighter1_895_966_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_895_966_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_895_966_Closed_Text.style.display='none'; Codehighlighter1_895_966_Open_Image.style.display='inline'; Codehighlighter1_895_966_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_895_966_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_895_966_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;--&quot;&nbsp;+&nbsp;s&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
        运行结果</font><br />
        <font face="Verdana">7个字符：<br />
        --asp.net<br />
        6个字符：<br />
        --csharp<br />
        5个字符：<br />
        --xhtml<br />
        3个字符：<br />
        --css<br />
        --wcf<br />
        --wpf<br />
        10个字符：<br />
        --javascript<br />
        11个字符：<br />
        --silverlight<br />
        4个字符：<br />
        --linq<br />
        --ssis<br />
        --ssas<br />
        --ssrs<br />
        2个字符：<br />
        --wf<br />
        9个字符：<br />
        --sqlserver<br />
        12个字符：<br />
        --asp.net ajax<br />
        <br />
        Join - Join查询；延迟<br />
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img id="Codehighlighter1_4_61_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_61_Open_Text.style.display='none'; Codehighlighter1_4_61_Closed_Image.style.display='inline'; Codehighlighter1_4_61_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_4_61_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_61_Closed_Text.style.display='none'; Codehighlighter1_4_61_Open_Image.style.display='inline'; Codehighlighter1_4_61_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_4_61_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                id="Codehighlighter1_4_61_Open_Text"><span style="COLOR: #808080">///</span><span 
                style="COLOR: #008000">&nbsp;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span 
                style="COLOR: #008000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;Join&nbsp;-&nbsp;Join查询；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;</span><span 
                style="COLOR: #808080">&lt;/summary&gt;</span></span><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span 
                style="COLOR: #000000">&nbsp;Summary_Join()<br />
            <img id="Codehighlighter1_90_962_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_90_962_Open_Text.style.display='none'; Codehighlighter1_90_962_Closed_Image.style.display='inline'; Codehighlighter1_90_962_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_90_962_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_90_962_Closed_Text.style.display='none'; Codehighlighter1_90_962_Open_Image.style.display='inline'; Codehighlighter1_90_962_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_90_962_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_90_962_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;使用Join查询操作符<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;products&nbsp;=&nbsp;_ctx.Products.Join(<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_ctx.Categories,&nbsp;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;=&gt;&nbsp;p.CategoryID,&nbsp;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;=&gt;&nbsp;c.CategoryID,&nbsp;<br />
            <img id="Codehighlighter1_278_310_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_278_310_Open_Text.style.display='none'; Codehighlighter1_278_310_Closed_Image.style.display='inline'; Codehighlighter1_278_310_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_278_310_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_278_310_Closed_Text.style.display='none'; Codehighlighter1_278_310_Open_Image.style.display='inline'; Codehighlighter1_278_310_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(p,&nbsp;c)&nbsp;=&gt;&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_278_310_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_278_310_Open_Text"><span style="COLOR: #000000">{&nbsp;c.CategoryName,&nbsp;p.ProductName&nbsp;}</span></span><span 
                style="COLOR: #000000">).Take(5);<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;p&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;products)<br />
            <img id="Codehighlighter1_367_460_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_367_460_Open_Text.style.display='none'; Codehighlighter1_367_460_Closed_Image.style.display='inline'; Codehighlighter1_367_460_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_367_460_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_367_460_Closed_Text.style.display='none'; Codehighlighter1_367_460_Open_Image.style.display='inline'; Codehighlighter1_367_460_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_367_460_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_367_460_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;p.CategoryName&nbsp;+&nbsp;&quot;&nbsp;-&nbsp;&quot;&nbsp;+&nbsp;p.ProductName&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;与上面的GroupBy查询操作符相对应的查询语法<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;products2&nbsp;=&nbsp;(from&nbsp;p&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ctx.Products<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;join&nbsp;c&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ctx.Categories<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;p.CategoryID&nbsp;equals&nbsp;c.CategoryID<br />
            <img id="Codehighlighter1_735_767_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_735_767_Open_Text.style.display='none'; Codehighlighter1_735_767_Closed_Image.style.display='inline'; Codehighlighter1_735_767_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_735_767_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_735_767_Closed_Text.style.display='none'; Codehighlighter1_735_767_Open_Image.style.display='inline'; Codehighlighter1_735_767_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_735_767_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_735_767_Open_Text"><span style="COLOR: #000000">{&nbsp;c.CategoryName,&nbsp;p.ProductName&nbsp;}</span></span><span 
                style="COLOR: #000000">).Take(5);<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;p&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;products2)<br />
            <img id="Codehighlighter1_825_918_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_825_918_Open_Text.style.display='none'; Codehighlighter1_825_918_Closed_Image.style.display='inline'; Codehighlighter1_825_918_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_825_918_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_825_918_Closed_Text.style.display='none'; Codehighlighter1_825_918_Open_Image.style.display='inline'; Codehighlighter1_825_918_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_825_918_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_825_918_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;p.CategoryName&nbsp;+&nbsp;&quot;&nbsp;-&nbsp;&quot;&nbsp;+&nbsp;p.ProductName&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
        运行结果</font><br />
        <font face="Verdana">Beverages - Chai<br />
        Beverages - Chang<br />
        Condiments - Aniseed Syrup<br />
        Condiments - Chef Anton&#39;s Cajun Seasoning<br />
        Condiments - Chef Anton&#39;s Gumbo Mix<br />
        <br />
        GroupJoin - 分组Join查询；延迟<br />
        <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
            <img id="Codehighlighter1_4_68_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_68_Open_Text.style.display='none'; Codehighlighter1_4_68_Closed_Image.style.display='inline'; Codehighlighter1_4_68_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_4_68_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_4_68_Closed_Text.style.display='none'; Codehighlighter1_4_68_Open_Image.style.display='inline'; Codehighlighter1_4_68_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_4_68_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span 
                id="Codehighlighter1_4_68_Open_Text"><span style="COLOR: #808080">///</span><span 
                style="COLOR: #008000">&nbsp;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span 
                style="COLOR: #008000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;GroupJoin&nbsp;-&nbsp;分组Join查询；延迟<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #808080">///</span><span style="COLOR: #008000">&nbsp;</span><span 
                style="COLOR: #808080">&lt;/summary&gt;</span></span><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" /><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">void</span><span 
                style="COLOR: #000000">&nbsp;Summary_GroupJoin()<br />
            <img id="Codehighlighter1_102_986_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_102_986_Open_Text.style.display='none'; Codehighlighter1_102_986_Closed_Image.style.display='inline'; Codehighlighter1_102_986_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" /><img 
                id="Codehighlighter1_102_986_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_102_986_Closed_Text.style.display='none'; Codehighlighter1_102_986_Open_Image.style.display='inline'; Codehighlighter1_102_986_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_102_986_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_102_986_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;使用GroupJoin查询操作符<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;products&nbsp;=&nbsp;_ctx.Categories.GroupJoin(<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_ctx.Products,&nbsp;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;=&gt;&nbsp;c.CategoryID,&nbsp;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p&nbsp;=&gt;&nbsp;p.CategoryID,&nbsp;<br />
            <img id="Codehighlighter1_300_343_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_300_343_Open_Text.style.display='none'; Codehighlighter1_300_343_Closed_Image.style.display='inline'; Codehighlighter1_300_343_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_300_343_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_300_343_Closed_Text.style.display='none'; Codehighlighter1_300_343_Open_Image.style.display='inline'; Codehighlighter1_300_343_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(p,&nbsp;g)&nbsp;=&gt;&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_300_343_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_300_343_Open_Text"><span style="COLOR: #000000">{&nbsp;p.CategoryName,&nbsp;ProductCount&nbsp;=&nbsp;g.Count()&nbsp;}</span></span><span 
                style="COLOR: #000000">);<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;g&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;products)<br />
            <img id="Codehighlighter1_392_485_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_392_485_Open_Text.style.display='none'; Codehighlighter1_392_485_Closed_Image.style.display='inline'; Codehighlighter1_392_485_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_392_485_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_392_485_Closed_Text.style.display='none'; Codehighlighter1_392_485_Open_Image.style.display='inline'; Codehighlighter1_392_485_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_392_485_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_392_485_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;g.CategoryName&nbsp;+&nbsp;&quot;：&quot;&nbsp;+&nbsp;g.ProductCount&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #008000">//&nbsp;与上面的GroupJoin查询操作符相对应的查询语法<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /></span><span 
                style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;products2&nbsp;=&nbsp;from&nbsp;c&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ctx.Categories<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;join&nbsp;p&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;_ctx.Products&nbsp;on&nbsp;c.CategoryID&nbsp;equals&nbsp;p.CategoryID&nbsp;into&nbsp;g<br />
            <img id="Codehighlighter1_741_799_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_741_799_Open_Text.style.display='none'; Codehighlighter1_741_799_Closed_Image.style.display='inline'; Codehighlighter1_741_799_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_741_799_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_741_799_Closed_Text.style.display='none'; Codehighlighter1_741_799_Open_Image.style.display='inline'; Codehighlighter1_741_799_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;</span><span 
                style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span 
                id="Codehighlighter1_741_799_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_741_799_Open_Text"><span style="COLOR: #000000">{&nbsp;CategoryName&nbsp;=&nbsp;c.CategoryName,&nbsp;ProductCount&nbsp;=&nbsp;g.Count()&nbsp;}</span></span><span 
                style="COLOR: #000000">;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                style="COLOR: #0000ff">foreach</span><span style="COLOR: #000000">&nbsp;(var&nbsp;g&nbsp;</span><span 
                style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;products2)<br />
            <img id="Codehighlighter1_849_942_Open_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_849_942_Open_Text.style.display='none'; Codehighlighter1_849_942_Closed_Image.style.display='inline'; Codehighlighter1_849_942_Closed_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img 
                id="Codehighlighter1_849_942_Closed_Image" align="top" alt="" 
                onclick="this.style.display='none'; Codehighlighter1_849_942_Closed_Text.style.display='none'; Codehighlighter1_849_942_Open_Image.style.display='inline'; Codehighlighter1_849_942_Open_Text.style.display='inline';" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span 
                id="Codehighlighter1_849_942_Closed_Text" 
                style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img 
                alt="" src="http://www.cnblogs.com/Images/dot.gif" /></span><span 
                id="Codehighlighter1_849_942_Open_Text"><span style="COLOR: #000000">{<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;g.CategoryName&nbsp;+&nbsp;&quot;：&quot;&nbsp;+&nbsp;g.ProductCount&nbsp;+&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" /><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span 
                style="COLOR: #000000"><br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result.InnerHtml&nbsp;+=&nbsp;&quot;&lt;br&nbsp;/&gt;&quot;;<br />
            <img align="top" alt="" 
                src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
        运行结果</font><br />
        <font face="Verdana">Beverages：12<br />
        Condiments：12<br />
        Confections：13<br />
        Dairy Products：10<br />
        Grains/Cereals：7<br />
        Meat/Poultry：6<br />
        Produce：5<br />
        Seafood：12</font><br />
    
    </div>
    </form>
</body>
</html>
